System and method for integrated header, state, rate and content anomaly prevention for session initiation protocol

ABSTRACT

Methods and systems for an integrated solution to the rate based denial of service attacks targeting the Session Initiation Protocol are provided. According to one embodiment, header, state, rate and content anomalies are prevented and network policy enforcement is provided for session initiation protocol (SIP). A hardware-based apparatus helps identify SIP rate-thresholds through continuous and adaptive learning. The apparatus can determine SIP header and SIP state anomalies and drop packets containing those anomalies. SIP requests and responses are inspected for known malicious contents using a Content Inspection Engine. The apparatus integrates advantageous solutions to prevent anomalous packets and enables a policy based packet filter for SIP.

COPYRIGHT NOTICE

Contained herein is material that is subject to copyright protection.The copyright owner has no objection to the facsimile reproduction ofthe patent disclosure by any person as it appears in the Patent andTrademark Office patent files or records, but otherwise reserves allrights to the copyright whatsoever. Copyright © 2013, Fortinet, Inc.

CROSS-REFERENCE TO RELATED PATENTS

This application relates to U.S. Pat. No. 7,426,634 entitled, “Methodand apparatus for rate based denial of service attack detection andprevention”, U.S. Pat. No. 7,602,731 entitled “System and method forintegrated header, state, rate and content anomaly prevention withpolicy enforcement”, and U.S. Pat. No. 7,626,940 entitled “System andmethod for integrated header, state, rate and content anomaly preventionfor domain name service” all of which are hereby incorporated byreference in their entirety for all purposes.

FIELD OF THE INVENTION

Embodiments of the present invention relate generally to intrusionprevention and more particular to a system and method for the preventionof denial of service (DoS) attacks on voice over IP protocols, such asSession Initiation Protocol (SIP).

DESCRIPTION OF THE BACKGROUND ART

Distributed Dos (DDoS) attack mitigation appliances have been in use dueto increasing distributed denial of attacks on various services. Theseservices include HTTP, DNS, among others. Voice over IP usage has beengrowing exponentially

As one skilled in the art knows, Internet attacks have been growing incomplexity and have been more wide-spread due to a variety of readilyavailable attack toolkits. Many of the recent DoS and DDoS attacks havebeen on SIP servers. By overloading the SIP servers, the attackers caneasily deny access to the associated web-service or other relatedInternet services. Clearly, a new method and system is needed to protectSIP servers from getting flooded with unwanted and illegitimaterequests.

SUMMARY

Methods and systems are described for an integrated solution to the ratebased denial of service attacks targeting the Session InitiationProtocol. According to one embodiment, header, state, rate and contentanomalies are prevented and network policy enforcement is provided forsession initiation protocol (SIP). A hardware-based apparatus helpsidentify SIP rate-thresholds through continuous and adaptive learning.The apparatus can determine SIP header and SIP state anomalies and droppackets containing those anomalies. SIP requests and responses areinspected for known malicious contents using a Content InspectionEngine. The apparatus integrates advantageous solutions to preventanomalous packets and enables a policy based packet filter for SIP.

Other features of embodiments of the present disclosure will be apparentfrom accompanying drawings and from detailed description that follows.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an exemplary apparatus embodying the presentinvention.

FIG. 2 schematically shows architectural details of FIG. 1, depictingsome of the key components necessary to implement a system according tothe present invention.

FIG. 3 illustrates further details of the specific implementation ofsession initiation protocol and related components in accordance with anembodiment of the present invention.

FIG. 4 illustrates a block diagram of the SIP engine in accordance withan embodiment of the present invention.

FIG. 5 illustrates parts of logic for classification of SIP packets overTCP and UDP within SIP Classifier in FIG. 3.

FIG. 6 illustrates a block diagram of components of the SIP Engineimplementation in hardware logic in accordance of an embodiment of thepresent invention.

FIG. 7 illustrates parts of logic for processing of INVITE requestduring normal and rate-flood situations in accordance with an embodimentof the present invention.

FIG. 8 illustrates parts of logic for processing of SIP requests otherthan INVITE requests such as Register, Refer and Option requests duringnormal and rate-flood situations in accordance with an embodiment of thepresent invention.

FIG. 9 illustrates parts of logic for processing of SIP CANCEL requestduring normal and rate-flood situations in accordance with an embodimentof the present invention.

FIG. 10 illustrates parts of logic for processing of SIP BYE requestduring normal and rate-flood situations in accordance with an embodimentof the present invention.

FIG. 10 illustrates parts of logic for processing of SIP other requestduring normal and rate-flood situations in accordance with an embodimentof the present invention.

FIG. 11 illustrates parts of logic for processing of other SIP requestssuch as ACK, PRACK and Update request during normal and rate-floodsituations in accordance with an embodiment of the present invention.

FIG. 12 illustrates parts of logic for processing of response packetsduring normal and rate-flood situations in accordance with an embodimentof the present invention.

FIG. 13 illustrates parts of logic for processing of SIP INVITE persource flood tracking during normal and rate-flood situations inaccordance with an embodiment of the present invention.

FIG. 14 illustrates parts of logic for processing of SIP REGISTER persource flood tracking during normal and rate-flood situations inaccordance with an embodiment of the present invention.

FIG. 15 illustrates parts of logic for processing of SIP concurrentINVITE per source flood tracking during normal and rate-flood situationsin accordance with an embodiment of the present invention.

FIG. 16 illustrates parts of logic for processing of source floodtracking for dropped packets during normal and rate-flood situations inaccordance with an embodiment of the present invention. This ensuresthat the same source is caught if it sends too many flood packets ofvarious kinds.

FIG. 17 illustrates parts of logic for processing of SIP URL floodtracking for dropped packets during normal and rate-flood situations inaccordance with an embodiment of the present invention. This ensuresthat a destination is identified as under attack in a multi-destinationSIP-URL scenario.

FIG. 18 illustrates parts of logic for processing of INVITE request inSIP user-agent meter during normal and rate-flood situations inaccordance with an embodiment of the present invention. The object ofthis is to identify same user-agent being used from plurality of sourcesin a multi-source bot flood.

FIG. 19 illustrates further details of the ager mechanism 605 inaccordance with an embodiment of the present invention.

FIG. 20 illustrates an exemplary computer system in which or with whichembodiments of the present invention may be utilized.

DETAILED DESCRIPTION

Methods and systems are described for an integrated solution to the ratebased denial of service attacks targeting the Session InitiationProtocol (SIP). Embodiments of the present invention provide anintegrated intrusion prevention solution for SIP related attacks. In oneembodiment, a single hardware based appliance integrates a plurality ofmechanisms to prevent different anomalies and enables a policy basedpacket filter.

Current trends in attack on SIP protocol relate to pre-attack probes,header anomalies, state anomalies, rate anomalies and content anomalies.

Embodiments of the present invention provide an appliance thatintegrates solutions to these different anomalies and provides anintegrated solution to the rate based denial of service attacks,especially on the Session Initiation Protocol.

The new appliance described herein provides copper and opticalconnectivity. A Packet Interface block interfaces with external networkthrough a PHY and a MAC device and buffers packets until a decision hasbeen made about them.

A Packet Classifier interfaces with Packet interface to classifier. TheRate Anomaly Meters receive classifier output and maintain theinstantaneous packet-rates and compare against the thresholds setadaptively and continuously by the controlling host.

If the specific type of packets exceeds the rate threshold, packets ofthat type or belonging to that group are discarded for a certain timeperiod.

The anomaly engines drop packets that have header or state anomalies indifferent layers of protocol.

A fragment reassembly engine reassembles any fragments according toprocesses well-known in the art. Assembled or un-fragmented packets arethen sent to an engine that removes any reordering issues orretransmission anomalies for TCP packets.

Ordered TCP as well as non-TCP packets are then sent to relevantprotocol normalization engines. The derived layers 2, 3, 4 and 7header-parameters and state information are then used by the Multi-rulesearch engine to find a rule-set that matches the incoming packet.

A rule-matching engine drives the content inspection engine to validateif contents of the packet match any of the anomalous signatures. AStateful sub-rule traversal engine then validates if further contents ofthe packet meet sub-signatures of the rule.

If a rule match is found, it is added to the event queue correspondingto the packet. A packet may match multiple rules.

After all the rules matches have been performed, a decision multiplexerpicks the highest priority rule match and informs the MAC interfacewhether to let the packet through or to drop the packet. Allowed packetsare then sent out.

An object of various embodiments of the present invention is to providea high-rate hardware based integrated system and method of preventingnetwork packets across, the packets having

layers 2, 3, 4, and 7 header anomalies and, more specifically, SIPheader anomalies;

layers 2, 3, 4, and 7 state transition and state based anomalies and,more specifically, SIP state transition anomalies;

layers 2, 3, 4, and 7 rate anomalies as detected by the system, which iscontinuously and adaptively adjusting rate thresholds and, morespecifically, SIP rate anomalies;

characteristics of network probes or reconnaissance as detected bycertain meters;

content anomalies as defined by a set of content rules; or

violation of network policies, as set by a system administrator.

Another object of various embodiments of the present invention is toprovide a SIP classifier that is capable of classifying TCP and UDPbased SIP packets and components of SIP protocol headers.

Still further object of various embodiments of the present invention isto provide a SIP Rate Anomaly Engine capable of continuously calculatingthe traffic rate on classified SIP parameters and estimating the trafficrate thresholds adaptively and thus determining the threshold violationson Session Initiation Protocol parameters such as register, invite etc.

Yet another object of various embodiments of the present invention is toprovide a SIP State Anomaly Engine that can validate SIP requests andresponses and that can drop them if there is no previous correspondingregister operation associated with them.

Still another object of various embodiments is to provide a method todetermine any known content patterns of intrusion in session initiationprotocol packets.

Still another object of various embodiments is to provide a method todetermine any known policy violations on session initiation protocolservice.

FIG. 1 depicts an exemplary apparatus 101 illustrating the functionalityof an integrated system 100 for the prevention of network attacks inaccordance with an embodiment of the present invention. The four mainattack prevention components are the Header and State Anomaly Prevention110, the Continuous Adaptive Rate Anomaly and Reconnaissance Prevention111, the Content Anomaly Prevention 112, and the Policy Lookup Engine113.

Inbound packets 102 enter the apparatus 101 and exit as cleansed inboundpackets 104. Similarly, outbound packets 103 enter the apparatus 101 andexit as cleansed outbound packets 105. The dropped packets make thedifference between packets at ingress and at egress. For the purpose offorensic analysis, these dropped packets are routed to two forensicports viz. the Dropped Inbound Packets 106, and the Dropped OutboundPackets 107.

Packets entering the system 100 are buffered in the Packet Interfaceblock 108. A copy of these packets is passed to the Classifier 109 whichpasses on the header and other relevant information over theClassification bus 115 to the subsequent blocks for decision making. ThePacket Interface block 108 receives a multiplexed decision about eachpacket buffered within and either allows the packets or drops thepackets. The drop packets are optionally copied to the forensic ports106 and 107.

The decision making operation of determining which packets need to bedropped is handled by the four major blocks, viz. the Header and StateAnomaly Prevention 110, the Rate Anomaly and Reconnaissance Prevention111, the Content Anomaly Prevention 112, and the Policy Lookup Engine113. They send the results to the Decision Multiplexer 114 via theDecision bus 116.

A controlling host such as a management CPU uses the Host Interface 118to read the controlling parameters and set the parameters of differentblocks via the Host Interface Bus 117. The controlling host alsoperiodically reads the granular traffic rates and uses it to estimatethreshold for rate parameters. The controlling host also reads eventsrelated to policy violations and anomalies. In some embodiments, theseevents are subsequently logged and/or analyzed.

The Header Anomaly Prevention block within 110 prevents packets thathave layers 2, 3, 4 and 7 header anomalies according to protocols underconsideration. For example, in an exemplary embodiment of thisinvention, layer 3 header anomaly prevention looks for packets that aremarked IPV4 packets in layer 2 header but do not have version 4 in theIP header. Similarly, besides other anomalies, layer 4 header anomalyprevention block looks for TCP packets that have illegal flagcombinations such as SYN and FIN set together. In an exemplaryembodiment of this invention, the layer 7 header anomaly preventionblock additionally looks for anomalous behavior such as non-SIP trafficdestined for TCP or UDP ports 5060.

The State Anomaly Prevention block within 110 prevents packets thatviolate standard state transitions in protocols. In an exemplaryembodiment of this invention, the layer 4 state anomaly prevention blockprevents packets that do not belong to any established connection andhave ACK bit on in the TCP flags. In an exemplary embodiment of thisinvention, the layer 7 state anomaly prevention block can additionallyprevent SIP Cancel requests that are arriving without the correspondingSIP registration or invite or if the CSeq number is incorrect.

The Continuous and Adaptive Rate Anomaly Prevention block within 112prevents instantaneous rate anomaly as detected through continuous andadaptive learning. In an exemplary embodiment of this invention, rateanomalies at network layers 2, 3, 4 and 7 are to be detected andprevented by this block. In an exemplary embodiment of this invention,SIP Request rate anomaly is prevented by detecting SIP Invite, Registerand other request packets exceeding their adaptively learnt threshold ina given direction.

The Reconnaissance Prevention block within 112 prevents reconnaissance(recon) activities. In an exemplary embodiment of this invention, as anexample, one of the recon prevention schemes is implemented utilizing aport-scan counter.

The Content Anomaly Prevention block 112 prevents packets that matchknown signature of attacks in the application content of the packet. Inan exemplary embodiment of this invention, these rules consist ofsignatures in the packet anywhere or within specifically parsed areas ofthe packets such as a SIP protocol payload. These signatures can beadded by the administrator based on a packet dump of incoming attackpackets if they see a repetitive pattern among them.

The Policy Lookup engine 113 prevents packets that violate the networkpolicies set by an administrator. In an exemplary embodiment, thepolicies are set by the administrator and include rules that allow ordeny packets based on interface, source IP address, destination IPaddress, IPV4 or IPV6 protocol, source port, destination port, and/orICMP type and code. In an exemplary embodiment, for SIP protocols,policies are available for a user to allow or deny packets with specificSIP parameters such as requests, responses, or specific values ofCALL-ID, From tag, To tag, To-URI, CSeq and User-agent header etc.

The Decision Multiplexer block 114 receives decisions from decisionmaking blocks 110, 111, 112, and 113 over the Decision bus 116, combinesthem as a single decision, and forwards them to the Packet Interfaceblock 108.

The controlling host can read the control registers and set them tomanage the functionality of different components. The controlling hostcan periodically read the maximum packet rates of different types ofpackets to come up with an adaptive threshold and program them using theHost Interface Block 118. The Host Interface Block 118 accesses otherblocks through the Host Interface Bus 117. The controlling host can alsoread the statistics related to packets being dropped due to anomalies orpolicy violation. The controlling host can then use this data forlogging and analysis. In an exemplary embodiment, the controlling hostcan read the maximum packet rates for SIP Request packets or responsepackets in two directions and set the adaptive thresholds for themthrough the Host Interface Block 118.

FIG. 2 illustrates further details of the system 100 from FIG. 1 inaccordance with an embodiment of the present invention. Packet Interface201 receives packets, buffers them, releases a copy of the packets tothe subsequent logic, re-releases another copy of the packets held uponorder from certain blocks, awaits decisions and subsequently eithertransmits them further or drops and/or transmits them on forensic ports.

The Classifier 109 is further illustrated in detail through the Layer 2Classifier 202, the Layer 3 Classifier 203, the Fragment ReassemblyEngine 204, the TCP Reorder Processing and the Layer 4 Classifier 205,Retransmission Removal Engine 206, the Layer 7 Classifier 207, and theProtocol Normalization Engine 208.

The Layer 2 Classifier 202 receives frames from Packet Interface 201 andclassifies packets based on their layer 2 characteristics. It parses thelayer 2 headers and passes that information to subsequent logic blocksover the Classification Bus 224. In an exemplary embodiment of thisinvention, this block can parse Ethernet frames and IEEE 802.2/3 framesand can determine ARP, RARP, Broadcast, Multicast, non-IP, VLAN taggedframes, and double encapsulated VLAN tagged frames.

The Layer 3 Classifier 203 receives packet data as well as layer 2classifier information from the Layer 2 Classifier 202. It extracts thelayer 3 header information in IPV4 and IPV6 headers and passes it on tothe subsequent logic over the Classification Bus 224. In someembodiments of this invention, the Classifier parses IPV4 and IPV6packets and determines properties such as TOS, IP Options,fragmentation, and protocol.

The Fragment Reassembly Engine 204 receives layer 3 header informationfrom the Layer 3 Classifier 203 as well as the packet data. In caseswhere the Layer 3 Classifier 203 informs that this packet is afragmented packet, the Fragment Reassembly Engine 204 requests thePacket Interface 201 to hold the packet. It also informs subsequentblocks not to inspect especially tagged fragmented packets, as they arenot yet assembled. It stores the information about fragments in itsinternal data-structures related to reassembly. Packets that are notfragmented are passed through. A timeout based mechanism is then used towait until all the fragments that belong together have been received. Anager based mechanism periodically wakes up and determines whether somefragments are over-age and discards them from memory.

Once the Fragment Reassembly Engine 204 determines that all fragmentscorresponding to one datagram are in-order and do not violate anyfragmentation related anomalies, it requests the Packet Interface 201 tore-release them in-order. These packets are then passed through thesubsequent blocks in order for further inspection. The FragmentReassembly Engine 204 therefore guarantees that blocks subsequent to italways receive datagram fragments in-order.

The Fragment Reassembly Engine 204 also determines whether there arefragmentation related anomalies and, if so, marks those packets asinvalid and informs the decision to the Decision Multiplexer 223 overthe Decision Bus 225. The techniques necessary to achieve fragmentassembly as well as fragmentation related anomaly prevention are wellknown to those skilled in the art and thus are not further describedherein. The allowed assembled packets leave as original unmodifiedpackets with their own packet ID, but they leave the Fragment ReassemblyEngine 204 in order so that subsequent blocks can inspect the content inorder.

The Layer 4 Classifier 205, similarly, parses the layer 4 informationfrom packets that are guaranteed to be in order with respect tofragmentation. In an exemplary embodiment, this classifier looks at TCP,UDP, ICMP, IPSec-ESP, and IPSec-AH headers. This information is passedto the subsequent blocks over the Classification Bus 224. In anexemplary embodiment of this invention, this classifier can parse layer4 information such as TCP Options, TCP ports, UDP Ports, ICMPtypes/codes, TCP flags, sequence numbers, ACK numbers etc. Packets thatare anomalous are dropped.

The TCP Reordering Processing and Retransmission Removal Engine 206receives classified packets from the Layer 4 Classifier 205. It onlymonitors TCP packets and it passes the rest further to subsequent blocksfor further inspection. It creates connection states in memory tablesand ensures that packets follow well-known TCP state transitions.Packets that are anomalous are dropped through a decision sent over theDecision Bus 225 to the Decision Multiplexer 223. Preferably, this blockfurther checks whether the packet's TCP sequence number is in order andwithin the receiver's window. Packets that are outside the window aredropped through the Decision Multiplexer 223. Packets that are in-orderand not retransmissions are passed through.

For all packets within the window that have not been acknowledged yet, aCRC based checksum is saved as part of the state for the connection. Itrequests subsequent blocks not to inspect the packets which are out oforder. It holds data structure related to such packets in memory. Forevery such packet stored in memory, a self-generated ACK is sent to thesender to facilitate quicker reordering. A timeout based mechanism isthen used to wait until expected sequence number arrives for theconnection. An ager based mechanism periodically wakes up and determineswhether some packets are over-age and discards them from memory. Theordered packets are then passed through the subsequent blocks in orderfor further inspection. This way, the subsequent blocks can alwaysassume that TCP packets will always be in-order.

The TCP Reordering Processing and Retransmission Removal Engine 206 alsodetermines whether there are retransmission related anomalies and, ifso, marks those packets as invalid and informs the decision to theDecision Multiplexer 223 over the Decision Bus 225. Retransmissionanomalies are determined using the stored CRC based checksum.Retransmitted packets that are equal or larger than the previoustransmission can be determined to be anomalous through a CRC comparison.Retransmissions that are smaller than earlier transmission arediscarded. The techniques necessary to achieve TCP reordering as well asretransmission related anomaly prevention are well known to thoseskilled in the art and thus are not further described herein. Theallowed ordered packets leave as original unmodified packets with theirown packet ID, but they leave the engine 206 in order so that subsequentblocks can inspect the content in order.

The Layer 7 Classifier 207 receives ordered fragments of IP datagrams,ordered TCP packets, specially flagged TCP retransmissions and otherpackets, and parses layer 7 header information. In an exemplaryembodiment of this invention, this block parses headers of protocolssuch as FTP, HTTP, TELNET, DNS, SIP, SMTP, POP, RPC, etc. It does sousing stateful parsing techniques well-known to those aware of the art.

In an embodiment of this invention, the FTP classifier within 207determines the commands and replies being used in the FTP packets.Commands parsed include USER, PASS, ACCT, CWD, CDUP, SMNT, REIN, QUIT,PORT, PASV, TYPE, STRU, MODE, RETR, STOR, STOU, APPE, ALLO, REST, RNFR,RNTO, ABOR, DELE, RMD, MKD, PWD, LIST, NLST, SITE, SYST, STAT, HELP,NOOP. 3-digit reply codes are parsed as well and grouped as positive andnegative.

In an embodiment of this invention, the HTTP classifier within 207determines the requests and replies being used in the HTTP packets.Requests are parsed as Method, Request-URI, Request-Header Fields, andHTTP-Version. The Method is further classified as OPTIONS, GET, HEAD,POST, PUT, DELETE, TRACE, CONNECT, and extension methods. The requestURI is isolated and passed further. Request-Header Fields such asAccept-Charset, Accept-Encoding, Accept-Language, Authorization, Expect,From, Host, If-Match, If-Modified-Since, If-None-Match, If-Range,If-Unmodified-Since, Max-Forwards, Proxy-Authorization, Range, Referer,TE, User-Agent. 3-digit status codes are parsed as well and grouped aspositive and negative.

In an embodiment of this invention, the TELNET classifier within 207determines the telnet commands. The commands classified are SE, NOP,Data Mark, Break, Interrupt Process, Abort Output, Are you there, Erasecharacter, Erase line, Go ahead, SB, WILL, Won't, Do, Don't and IAC.

In an embodiment of this invention, the TELNET classifier within 207determines the telnet commands. The commands classified are SE, NOP,Data Mark, Break, Interrupt Process, Abort Output, Are you there, Erasecharacter, Erase line, Go ahead, SB, WILL, Won't, Do, Don't and IAC.

In an embodiment of this invention, the DNS classifier within 207 parsesthe DNS queries. The parser breaks the DNS message into Header,Question, Answer, Authority, and Additional sections. The header isfurther parsed to determine whether the message is a query, response orsome other code. The Question section is further parsed as QNAME, QTYPEand QCLASS. The Answer section is further classified as resource record(RR) consisting of Domain Name, Type, Class, TTL, and Resource datalength.

In an embodiment of this invention, the SIP classifier within 207determines the requests and responses being used in the SIP packets.Requests are parsed as Method and Request-URI. The Method is furtherclassified as REGISTER, INVITE, ACK, CANCEL, BYE, OPTION AND PRACK.Request-Header Fields, such as CALL-ID, To, From, To-URI, CSeq andUser-agent header, are parsed as well. Responses are further decoded aspositive and negative.

In an embodiment of this invention, the SMTP classifier within 207parses the SMTP commands and replies. The commands are further parsed asEHLO, HELO, MAIL, RCPT, DATA, RSET, VRFY, EXPN, HELP, NOOP, and QUIT.Replies are further decoded as positive and negative.

In an embodiment of this invention, the POP classifier within 207 parsesthe POP commands and responses. The commands are further parsed as USER,PASS, APOP, QUIT, STAT, LIST, RETR, DELE, NOOP, RSET, TOP, UIDL, andQUIT. Responses are further decoded as positive and negative.

In an embodiment of this invention, the RPC classifier within 207 parsesthe RPC message. The message is parsed as transaction id, followed bythe call or reply. The call is further parsed as RPC version, programnumber, version number, procedure and the rest of the call body. Thereply is further parsed as accepted or denied.

Layer 7 State Anomaly Engine 217 takes classified data from the SIPClassifier 207 and maintains stateful transitions.

Protocol Normalization Engine 208 receives classified packets andnormalizes the parsed data so that it can be inspected for contentanomalies. In a preferred embodiment of the invention, the normalizationis done for URI portion of the within HTTP. The normalizations includeHex-encoding, Double Percent Hex-encoding, Double Nibble Hex Encoding,First Nibble Hex Encoding, Second Nibble Hex Encoding, UTF-8 Encoding,UTF-8 Bare Byte Encoding, Unicode, Microsoft % U encoding, Alt-Unicode,Double encode, IIS Flip Slash, White-space, etc. In a preferredembodiment of this invention the normalization is done for RPC recordsby consolidating records broken into more than one record fragment intoa single record fragment. In a preferred embodiment of this invention,the TELNET protocol normalization removes negotiation sequences. Thisnormalization prunes negotiation code by copying all non-negotiationdata from the packet. In a preferred embodiment of this invention, theTELNET normalization is also performed on the FTP packets.

The Continuous and Adaptive Rate Anomaly block within 111 is furtherillustrated in the Layer 2 Rate Anomaly Meters 209, the Layer 3 RateAnomaly Meters 211, the Layer 4 Rate Anomaly Meters 213, and the Layer 7Rate Anomaly Meters 215. The meters 209, 211, and 213 continuously andadaptively determine rate thresholds for layers 2, 3 and 4 networkparameters and determine whether flood is occurring for any of theparameters. A controlling host uses the Host Interface 226 to learn therate and set the threshold. All the meters support a two-waycommunication with the host through the Host Interface Bus 227. Theabove referenced co-pending U.S. patent application Ser. No. 10/759,799,entitled “METHOD AND APPARATUS FOR RATE BASED DENIAL OF SERVICE ATTACKDETECTION AND PREVENTION,” discusses in detail how rate based denial ofservice attacks can be prevented using a continuous and adaptivelearning approach for layers 2, 3 and 4 based attacks.

The Layer 7 Rate Anomaly Meters 215 continuously and adaptivelydetermine rate thresholds for layer 7 network parameters and determinewhether flood is occurring for any of the parameters. In an exemplaryembodiment, the apparatus can detect and prevent application layerfloods such as HTTP Request Type Floods, HTTP Failure Floods, FTPRequest Floods, FTP Failure Floods, DNS Query Floods, DNS ResponseFloods, SIP Floods.

According to one embodiment of the present invention, a SIP Request RateAnomaly Meter prevents SIP request transactions from being used moreoften than the previously observed threshold. The Host Interface Bus 227is used to inform the controlling host, via the Host Interface 226, ofthe continuous rates being learnt so that the controlling host canadaptively set the thresholds for layer 7 Rate Anomaly Meters 215.

The Recon Prevention sub-block within 111 is further illustrated in theLayer 3 Recon Prevention sub-block within 211 and the Layer 4 ReconPrevention sub-block within 213. The Layer 3 Recon Prevention sub-blockwithin 211 prevents reconnaissance activity at layer 3. In an exemplaryembodiment of this invention, this block prevents IP-address scanning,using information received from the layer 3 classifier and determineswhether a single source is connecting to many IP addresses within ashort interval. In another embodiment of this invention, this blockprevents dark-address scanning, using information received from thelayer 3 classifier and determines whether a source is scanning unused IPaddress ranges.

The Layer 4 Recon Prevention sub-block within 213 preventsreconnaissance activity at layer 4. In an exemplary embodiment of thisinvention, this block prevents port-scanning, using information receivedfrom the layer 3 and layer 4 classifiers and determines whether a singlesource is connecting to many layer 4 TCP/UDP ports within a shortinterval

The Header and State Anomaly Prevention block within 110 is furtherillustrated in the Layer 2 Anomaly Engine 210, the Layer 3 AnomalyEngine 212, the Layer 4 Anomaly Engine 214, and the Layer 7 AnomalyEngine 216. The Engines 210, 212, 214 and 216 receive correspondingclassifier outputs over the Classification Bus 224 and determine whetherthe header has any anomaly or whether the state transition due to headervalues leads to anomalies. The packets determined to be anomalous aredropped via a decision sent over the Decision Bus 225 to the DecisionMultiplexer 223.

The Layer 3 and Layer 4 Anomaly Engine 212 and 214 detect and preventIPV4 packets that have one or more of the following anomalies:

invalid IP header checksum,

version other than 4,

source or destination equivalent to local host,

same source and destination,

end of packet before 20 bytes,

end of packets before the length specified by total length,

end of packet while parsing options,

option length less than 3,

time to live is 0,

protocol corresponding to ipv6, etc.

In some embodiments, the Layer 3 Anomaly Engine 212 detects and preventsIPV6 packets that have one or more of the following anomalies:

version other than 6,

source or destination equivalent to local host,

same source and destination,

end of packet before the header,

end of packet in the middle of the headers,

end of packet while parsing options,

same extension header occurring more than once,

hop-limit of 0,

Protocol corresponding to ipv4, etc.

In some embodiments, the Layer 3 Anomaly Engine 212 also preventsfragmented packets that have over assembly related anomalies as detectedby Fragment Assembly Engine 204.

In some embodiments, the Layer 4 Anomaly Engine 214, detects andprevents TCP packets that have one or more of the following anomalies:

data offset less than 5,

TCP checksum error,

illegal TCP flag combinations,

urgent flag set, but urgent pointer is zero,

end of packet before 20 bytes of TCP header,

length field in window scale option is other than 3,

TCP Option length is less than 2, etc.

In some embodiments, the Layer 4 State Anomaly Engine 214, detects andprevents UDP packets that have one or more of the following anomalies:

optional UDP checksum error,

end of packet before 8 bytes of UDP header, etc.

In some embodiments, the Layer 4 State Anomaly Engine 214 detects andprevents TCP packets that violate valid state transitions that areexpected by standard TCP state machines. For this purpose, it receivesinformation from the Layer 4 Classifier 205 and the TCP ReorderProcessing and Retransmission Removal Engine 206. Packets that areoutside the receiver's window as maintained by the state table are alsodropped for being anomalous. Retransmitted packets that are determinedby the Retransmission Removal engine 206 to be different from theoriginal transmission are also dropped by the Layer 4 State AnomalyEngine 214.

In some embodiments, the Layer 7 Anomaly Engine 216 prevents statetransition anomalies at layer 7 protocols such as HTTP, e.g., the GETkeyword for request method must be followed by a URI. Similarly, the FTPprotocol Anomaly Engine within 216 can identify requests that are withinthe allowed requests as defined in the RFC. In an exemplary embodimentof this invention, the SIP anomaly engine can prevent a SIP BYE withoutan associated SIP REGISTER.

The Content Anomaly Prevention block 112 is further illustrated via itssub-components Multi-Rule Search Engine 218, Rule Matching Engine 219,Stateful Sub-rule Traversal Engine 220, Event Queuing Engine 221, andContent Inspection Engine 222, the Classification Bus 224. Part of thisinformation, viz. Interface, Source IP Address, Destination IP Address,Protocol, Source Port, and Destination Port, is used to first searchthrough a search engine to determine whether the packet violates anypolicies. If so, the packet is dropped through a decision conveyed over,the Decision Bus 225 and the Decision Multiplexer 223.

If the search matches certain rules and requires further contentinspection, the Rule Matching Engine 219 sends the assembled, ordered,normalized data to the Content Inspection Engine 222. An external hostloads the contents of the BRAM, SRAM, and DRAM of the Content InspectionEngine 222 with necessary signatures corresponding to the rule-setsthrough the Host Interface 226 over the Host Interface Bus 227.

The Content Inspection Engine 222 can start the initial state at aspecific point where the last match for the previous packet hadoccurred. This helps in statefully matching the strings across packets.

Once the Rule Matching Engine 219 determines, via the Content InspectionEngine 222, that the packet matches at least one of the signatures, itneeds to statefully walk through all the optional sub-signatures withinthe rule. The statefulness is required because the signatures may besplit across fragmented packets or reordered packets. For this purpose,the state of the last match where it was left is kept in the memory forthe specific connection.

Once all signatures are found to be present in the packet, the rule issaid to be matched. Such a match is denoted as an event. This event isqueued against the packet's ID in the Event Queuing Engine 221.

A packet may match multiple such events. A priority scheme within theEvent Queuing Engine 221 picks the highest priority event from thedetermined events for the packet and informs the corresponding decisionto the Decision Multiplexer 223 over the Decision Bus 225.

Blocks such as 209, 210, 211, 212, 213, 214, 215, 216, 218, 219, and 221inform of their decision, whether to drop the packet or not, to theDecision Multiplexer 223.

FIG. 3 further illustrates the details for Layer 7 classifier usingexemplary SIP Classifier 307 in accordance with an embodiment of thepresent invention. It similarly illustrates further details of the layer7 rate anomaly meters 215, Layer 7 Anomaly Engine 216 and Layer 7 StateAnomaly Engine 217.

In an exemplary embodiment, the SIP classifier 307 classifies all SIPpackets over TCP or UDP by parsing them in detail. The SIP Classifier307 identifies TCP/UDP SIP packets based on destination port, itclassifies them into SIP requests and responses.

In an exemplary embodiment, the SIP Rate Anomaly Meter 315 detects rateanomalies for the following SIP packets:

Register Flood,

Invite Flood,

Cancel Flood,

Bye Flood, and

Additional Flood

The rate anomaly determination is done using continuous learning ofrates which are passed to the host through the Host Interface 325. Thehost sets adaptive thresholds for the above floods.

The SIP Header Anomaly Engine 316 takes classified data from the SIPClassifier 307 and determines well-known anomalies such as following:

-   -   CSeq number greater than 2^31    -   CSeq header method not matching with method name in request line    -   Max-Forward header value greater than 70    -   SIP method not matching with any of the specified methods

These are further described below with reference to FIG. 5.

SIP State Anomaly Engine 317 takes classified data from the SIPClassifier 307 and maintains stateful transitions. For example,ACK/CANCEL/BYE packets with no corresponding entry in SIP table can bedropped. Another example would be that the CSeq number has to be thesame for ACK/CANCEL packets corresponding to the INVITE request. Thusthe ACK/CANCEL packets with the CSeq number mismatch can be dropped eventhough all the other session parameters match. This ensures preventionof spurious messages from reaching the protected server.

Other blocks in FIG. 3, such as Packet Interface 301, Layer 2 Classifier302, Layer 3 Classifier 303, Layer 4 Classifier 305, DecisionMultiplexer 323 and Host Interface 326, may be the same as thecounterparts described with reference to FIG. 2.

FIG. 4 further illustrates the details for SIP header, rate and stateanomaly engine in accordance with an embodiment of the presentinvention. In one embodiment, the engine comprises a per source floodchecking module 470, a SIP meter 420, a method floods module 430, a SIPUser-agent flood module 440, a SIP URI flood module 450. The enginereceives header information from SIP header classifier 410 and passesdecisions made by individual modules of the engine through the DecisionBus to Decision Multiplexer 460.

In this example, SIP meter 420 is configured to check any anomalies inthe SIP packets. SIP meter 420 further comprises a CSeq validationmodule 422, a state anomalies module 423, a foreign packet module 424, are-transmit checking 425 and an ager 426. CSeq validation module 422 isconfigured to check if a Command Sequence (CSeq) in a SIP request is aninteger and is incremented for each new request within a dialog. Stateanomalies module 423 is configured to check if any state anomaliesexisting in the SIP request. State anomalies module 423 will be furtherdescribed in greater detail with reference to FIG. 6. Foreign packetmodule 424 is configured to block packets which outside of a known SIPsession. Re-transmit checking module 425 is configured to checkretransmissions within a SIP session. The Ager 426 is capable ofperforming a timer-based aging of the memory tables. This is furtherdescribed with reference to FIG. 19.

Per source flood checking module 470 can be configured to check thenumber of requests from the same source IP address. When the numberexceeds a predetermined threshold that source can be blocked as anattacker.

Method floods module 430 can be configured to check the numbers ofindividual types of requests. When the number of one type of requestsexceeds a predetermined threshold, method floods module 430 decides thata method-flood has occurred and that any source IP sending packets withthis method can be determined to be a potential attacker. Through SourceTracking mechanism, those IPs that send a plurality of such packets withmethods under attack can be isolated and blocked.

SIP UA flood module 440 can be configured to check the number ofuser-agent header in INVITE requests. When the number of user-agentheader in INVITE requests exceeds a predetermined threshold, SIP UAflood module 430 decides that a SIP UA flood occurred. Any source IPsending packets with this method can be determined to be a potentialattacker. Through Source Tracking mechanism, those IPs that send aplurality of such packets with methods under attack can be isolated andblocked.

SIP URI flood module 450 can be configured to check the number of SIPURI in INVITE requests. When the number of SIP URI in INVITE requestsexceeds a predetermined threshold, SIP URI flood module 440 decides thata SIP URI flood has occurred and that any source IP sending packets withthis method can be determined to be a potential attacker. Through SourceTracking mechanism, those IPs that send a plurality of such packets withmethods under attack can be isolated and blocked.

FIG. 5 further illustrates the details of SIP Classifier 307 inaccordance with an embodiment of the present invention. FIG. 5illustrates how SIP packets over UDP/TCP are parsed.

At step 501, If a SIP packet has a source or destination port equal to5060 or 5061, it is considered for further parsing. Based on thepositions, at step 503, CALL-ID, To tag, From tag, To-URI, CSeq,user-agent header and etc. are extracted per RFC. If it is not a SIPpacket, the packet is allowed and no further SIP processing is requiredat step 502.

Next, the extracted parameters are checked to see any anomalies exist.At step 504 a, the SIP header classifier checks for mandatory headersnot present anomaly, such as To, From, CALL-ID, CSeq, Via andMax-Forward parameters in the mandatory header are accord with RFC. Atstep 504 b, the SIP header classifier checks CSeq number anomaly, suchas if it is greater than 2^31. At step 504 c, the SIP header classifierchecks for CSeq header method not matching with method name in requestline. At step 504 d, the SIP header classifier checks for Max-Forwardheader value greater than 70 anomalies. At step 504 e, the SIP headerclassifier checks for known opcode anomaly (SIP method not matching withany of the specified opcodes). At step 505, the SIP header classifierchecks any of the anomalies exists. If yes, the SIP header classifierchecks if drop anomaly feature is set to ON at step 506. If yes, thepacket is source tracked and dropped at step 507. If decisions of steps505 and 506 are no, the SIP packet is further checked to see if it is aSIP request at step 508. If yes, the SIP request is parsed at step 510.If no, the packet is a SIP response, and the SIP response is furtherparsed at step 509. This is further illustrated in FIGS. 7-18.

FIG. 6 further illustrates the integrated details of SIP StateProcessing Engine of FIG. 3 in accordance with an embodiment of thepresent invention.

SIP State Anomaly Engine 601 consists of a Packet Processing Engine 602,a Memory Interface 603, a Host Interface Processor 604, an Ager 605, andthree memory based tables viz. State Machine Table 606, SIP SourceTracking Table 607, and SIP URI Table 608.

The Packet Processing Engine 602 interfaces with Classifiers includingthe SIP Classifier on one end and the Decision Multiplexer 322 on theother end. It decides whether a given packet should be allowed ordropped based on state of the system and several other factors discussedbelow.

The Memory Interface 603 allows controlled, shared and prioritizedaccess to a high speed memory to the Packet Processing Engine 602, theHost Interface Processor 604, and the Ager 605.

The Host Interface Processor 604 allows the controlling host to controlthe parameters within the Packet Processing Engine 602, and read thestatistics as well as initialize and manage the memory tables 606, 607,and 608.

The Ager 605 is capable of performing a timer-based aging of the memorytables 606, 607, and 608. This is further described below.

Table 1 describes the memory table 606 in accordance with an embodimentof the present invention.

TABLE 1 SIP State Machine Table Name Width in bits Description Fwd CSeq40 Forward CSeq RW CSeq 40 Reverse CSeq Call ID 32 Call ID Fwd Tag 32Forward Tag RW Tag 32 Reverse Tag FSM State 32 Finite session MachineCollision 20 Collision Pointer PointerTable 1 describes the memory table 607 in accordance with an embodimentof the present invention.

TABLE 2 SIP Per-Source flood data structure SNo Name of the fieldWidth 1. Flags 7 (use bit, col ptr vld, ip type, invite/src block flag,register/src block flag, direction, proxy ip flag) 2. VID 3 3. Collisionpointer 20 4. Source IP address 128 5. Entry timeout 16 6. ConcurrentINVITE per source count 12 7. SIP REGISTER per source count 12 8. SIPINVITE per source count 12 9. Flood flags (invite/src flood flag,concurrent invite/src 3 flood flag, register/src flood flag)Table 1 describes the memory table 608 in accordance with an embodimentof the present invention.

TABLE 3 SIP URL flood data structure SNo Name of the field Width 1.Packet count in Outbound direction 31 2. Threshold in Outbound direction31 3. Accumulated Drop count in Outbound direction 23 4. Flags inOutbound direction (Zero sectick entry 4 timeout flag, Use bit, Blockflag, Deny flag) 5. Entry Timeout in Outbound direction 4 6. Max packetcount in Outbound direction 30 7. Packet count in Inbound direction 318. Threshold in Inbound direction 31 9. Accumulated Drop count inInbound direction 23 10. Flags in Inbound direction (Zero sectick entry4 timeout flag, Use bit, Block flag, Deny flag) 11. Entry Timeout inInbound direction 4 12. Max packet count in Inbound direction 30

Preferably, all three tables are implemented using hashed indexes andcollision pointers. Those skilled in the art can easily appreciate suchimplementations. Therefore, they are not further described herein indetails.

The Ager 605 comprises a background process that runs every second. Thebackground process periodically reads the above three tables. For everyentry, it compares the timeout value with a free running second tickcounter. If the time is out, the entry is deleted. This ensures thatstale entries do not remain in the table. In some embodiments, the Ager605 also collects statistics related to entries in the tables and sendsthem to host through the Host Interface Processor 604. Operations ofager 605 will be described in detail with reference to FIG. 19.

FIG. 7 illustrates the details of processing of INVITE request inaccordance with an embodiment of the present invention. At step 701, aSIP request is checked to see if it is an INVITE request. If it isindeed an INVITE request, at step 702, flood state is checked. If theflood state is ON, then at step 703, the INVITE source request istracked. This ensures that same set of sources do not cause this INVITEflood and dropped to stop flood attack. If flood state is not ON at step702, an invite packet count is compared with a threshold at step 704. Ifthe invite packet count exceeds the threshold, the flood state is set toON for a specified time period at step 706 and the request is sourcetracked and dropped at step 703. If the INVITE request count does notexceed the threshold at step 704, the request is allowed at step 705. Ifcommon response is allowed at step 707, the invite packet count isincremented at step 708. Otherwise, the invite packet count is notupdated at step 709.

FIG. 8 illustrates the details of processing of non-INVITE requests inaccordance with an embodiment of the present invention. At step 801, aSIP request is check to see if it is a REGISTER, REFER or OPTIONSrequest. If yes, at step 802, flood state is checked. If the flood stateis ON, then at step 803, the non-Invite request is source tracked anddropped to stop flood attack. If flood state is not ON at step 802, acorresponding packet count is compared with a threshold at step 804. Ifthe corresponding packet count exceeds the threshold, the flood state isset to ON for a specified time at step 806 and the request is sourcetracked and dropped at step 803. If the corresponding request count doesnot exceed the threshold at step 804, the request is allowed at step805. Next, if common response is allowed at step 807, the correspondingpacket count is incremented at step 808. Otherwise, the correspondingpacket count is not updated at step 809.

FIG. 9 illustrates the details of processing of SIP CANCEL request inaccordance with an embodiment of the present invention. At step 901, aSIP request is check to see if it is a CANCEL request. If not, at step902, other requests are processed. If the request is a CANCEL request,the CANCEL request is matched with entries in the SIP Source TrackingTable 607 at step 903. If there is no match, the request is sourcetracked and dropped as foreign packet at step 904. If the CANCEL requestis matched in step 903, then at step 905, the state of the CANCELrequest is checked by the state anomalies module according to the SIPState Machine Table 606. If the state anomaly validation is not passed,the request is source tracked and dropped at step 906. If the stateanomaly validation is passed, then at step 907, the CSeq number of theCANCEL request is checked by the CSeq validation module 422. If the CSeqnumber validation is not passed, the request is source tracked anddropped at step 906. If the CSeq number validation is passed, the CANCELrequest is allowed and a session state is updated accordingly at step908.

FIG. 10 illustrates the details of processing of SIP BYE request inaccordance with an embodiment of the present invention. At step 1001, aSIP request is check to see if it is a BYE request. If not, at step1002, other requests are processed. If the request is a BYE request, theBYE request is matched with entries in the SIP Source Tracking Table 607at step 1003. If there is no match, the request is source tracked anddropped as foreign packet at step 1004. If the BYE request is matched instep 1003, then at step 1005, the state of the BYE request is checked bythe state anomalies module according to the SIP State Machine Table 606.If the state anomaly validation is not passed, the request is sourcetracked and dropped at step 1006. If the state anomaly validation ispassed, then at step 1007, the CSeq number of the BYE request is checkedby the CSeq validation module 422. If the CSeq number validation is notpassed, the request is source tracked and dropped at step 1006. If theCSeq number validation is passed, the BYE request is allowed and asession state is updated accordingly at step 1008.

FIG. 11 illustrates the details of processing of other requests inaccordance with an embodiment of the present invention. At step 1101, aSIP request is check to see if it is an ACK, PRACK or UPDATE request. Ifnot, at step 1102, other requests are processed. If the request isindeed an ACK, PRACK or UPDATE request, the request is matched withcorresponding entries in the SIP Source Tracking Table 607 at step 1103.If there is no match, the request is source tracked and dropped asforeign packet at step 1104. If the request is matched in step 1103,then at step 1105, the corresponding state of the request is checked bythe state anomalies module according to the SIP State Machine Table 606.If the state anomaly validation is not passed, the request is sourcetracked and dropped at step 1106. If the state anomaly validation ispassed, then at step 1107, the CSeq number of the request is checked bythe CSeq validation module 422. If the CSeq number validation is notpassed, the request is source tracked and dropped at step 1106. If theCSeq number validation is passed, the request is allowed and acorresponding session state is updated accordingly at step 1108.

FIG. 12 illustrates the details of processing of SIP response packets inaccordance with an embodiment of the present invention. At step 1201, aSIP response is check to see if it is valid response per RFC. If not, atstep 1202, other responses are processed. If the response is valid, theresponse is matched with corresponding entries in the SIP SourceTracking Table 607 at step 1203. If there is no match, the response issource tracked and dropped as foreign packet at step 1204. If theresponse is matched in step 1203, then at step 1205, the CSeq number ofthe response is checked by the CSeq validation module 422. If the CSeqnumber validation is not passed, the response is source tracked anddropped at step 1206. If the CSeq number validation is passed, theresponse is allowed and a corresponding session state is updatedaccordingly at step 1207.

FIG. 13 illustrates the details of processing of SIP INVITE per sourceflood tracking in accordance with an embodiment of the presentinvention. This ensures that a single IP address doesn't send too manySIP INVITEs in a short duration. At step 1301, a source IP address of anINVITE request is matched with source IP addresses entries in the SIPSource Tracking Table 607. If there is no match, the request is allowedat step 1302. Then if common response is allowed at step 1309, packetcount for INVITE request from the source IP address is incremented or anew count is created at step 1311. If common response is not allowed,the packet count is not updated at step 1310. Back to step 1301, if theINVITE request is from the same source IP address, then a flood state ischecked at step 1303. If the flood state is ON, a block source featurecontrol is checked at step 1305. If the block source feature control isON, then the invite request is dropped and INVITE requests from thesource IP address is completely blocked at step 1307. If the control isnot ON at step 1305, then the INVITE request is source tracked anddropped at step 1306. If the flood state is not ON at step 1303, then apacket count of INVITE request is compared with a threshold at step1304. If the threshold is not exceeded, the request is allowed at step1302. If the threshold is exceeded, the flood state is entered for aspecified time at step 1308.

FIG. 14 illustrates the details of processing of REGISTER per sourceflood tracking in accordance with an embodiment of the presentinvention. This ensures that a single Source IP doesn't register toomany times within a short period. At step 1401, a source IP address of aREGISTER request is matched with source IP addresses entries in the SIPSource Tracking Table 607. If there is no match, the request is allowedat step 1402. Then if common response is allowed at step 1409, packetcount for REGISTER request from the source IP address is incremented ora new count is created at step 1411. If common response is not allowed,the packet count is not updated at step 1410. Back to step 1401, if theREGISTER request is from the same source IP address, then a flood stateis checked at step 1403. If the flood state is ON, a block sourcefeature control is checked at step 1405. If the block source featurecontrol is ON, then the REGISTER request is dropped and REGISTERrequests from the source IP address is completely blocked at step 1407.If the control is not ON at step 1405, then the REGISTER request issource tracked and dropped at step 1406. If the flood state is not ON atstep 1403, then a packet count of REGISTER request is compared with athreshold at step 1404. If the threshold is not exceeded, the request isallowed at step 1402. If the threshold is exceeded, the flood state isentered for a specified time at step 1408.

FIG. 15 illustrates the details of processing of concurrent invite persource flood tracking in accordance with an embodiment of the presentinvention. This ensures that a single source IP address doesn't buildtoo many concurrent SIP connections. At step 1501, a source IP addressof an INVITE request is matched with source IP addresses entries in theSIP Source Tracking Table 607. If there is no match, the request isallowed at step 1503. Then if common response is allowed at step 1507,concurrent packet count for INVITE request from the source IP address isincremented or a new count is created at step 1509. If common responseis not allowed, the packet count is not updated at step 1508. Back tostep 1501, if the INVITE request is from the same source IP address,then a concurrent packet count is compared with a threshold at step1502. If the threshold is not exceeded, then the INVITE request isallowed at step 1503. If the threshold is exceeded, block source featurecontrol is checked at step 1504. If the control is ON, the INVITErequest is dropped and the request from the source IP address iscompletely blocked. If the control is not ON, the INVITE request issource tracked and dropped at step 1505.

FIG. 16 illustrates the details of processing of source flood trackingfor dropped packets in accordance with an embodiment of the presentinvention. The purpose of this is to ensure that once a specific type offlood has been detected from among a plurality of attacks discussedearlier—including SIP INVITE, REGISTER, CANCEL flood etc., if a limitednumber of sources are responsible for such a flood, they should bespecifically and quickly blocked rather than generic operations such asINVITE, REGISTER or CANCEL requests. At step 1601, when a packetarrives, we check if there is an existing flood occurring at theinstance. If there is no flood happening, the count for the source issimply incremented by a factor of 1 at step 1602. If there is a floodoccurring and the source is sending a packet of that kind, the source'spacket rate is incremented by a penalty factor in step 1603. The newcount is then compared with a pre-specified threshold in step 1603. Ifthe threshold is not exceeded, then the drop count is updated at step1604. If the threshold is exceeded, packets for the source IP address isblocked for specified time at step 1605.

FIG. 17 illustrates the details of processing of SIP URI flood trackingin accordance with an embodiment of the present invention. This ensuresthat the same SIP URI is not attacked by anyone again and again. Sourcesthat send packet to a specific URI under attack at an instance aremultiplicatively punished by a penalty factor to isolate them quickly.This ensures that the URI doesn't remain blocked for long but thesources that send request to the URI are blocked and isolated quickly.At step 1701, a URI in To tag of an INVITE request is matched withentries in the SIP Source Tracking Table 607. If there is no match, therequest is allowed at step 1702. If the INVITE request is to the sameURI, then a flood state is checked at step 1703. If the flood state isON, the INVITE request is source tracked and dropped at step 1704. Ifthe flood state is not ON, then a packet count of invite to the same URIis compared with a threshold at step 1705. If the threshold is notexceeded, the request is allowed at step 1707. Then if common responseis allowed at step 1708, the packet count for invite to the same URI isincremented or a new count is created at step 1711. If common responseis not allowed, the packet count for invite to the same URI is notupdated at step 1709. If the packet count exceeds the threshold at step1705, the flood state is entered for a specified time at step 1706. Thenthe INVITE request is source tracked and dropped at step 1704.

FIG. 18 illustrates the details of processing of SIP user-agent floodtracking in accordance with an embodiment of the present invention. Thepurpose of this is to isolate SIP user-agents which might be attackingthe protected server from a distributed number of user-agents. At step1801, if a user-agent header presents in an INVITE request is checked.If there is no user-agent header presents in the INVITE request, ananomaly checking state is checked at step 1802. If the anomaly checkingis not ON, the INVITE request is allowed and no further processing isneeded at step 1804. If the anomaly checking is ON, the INVITE requestis source tracked and dropped/logged at step 1805. Back to step 1801, ifa user-agent header presents in the INVITE request, a flood state ischecked at step 1803. If the flood state is ON, the INVITE request issource tracked and dropped/logged at step 1805. If the flood state isnot ON, then a packet count of INVITE requests having user-agent headersis compared with a threshold at step 1806. If the threshold is notexceeded, the request is allowed at step 1808. Then if common responseis allowed at step 1809, the packet count for INVITE requests havinguser-agent headers is incremented or a new count is created at step1811. If common response is not allowed, the packet count for INVITErequests having user-agent headers is not updated at step 1810. If thepacket count exceeds the threshold at step 1806, the flood state isentered for a specified time at step 1807. Then the INVITE request issource tracked and dropped at step 1805.

FIG. 19 illustrates the details of processing of an ager in accordancewith an embodiment of the present invention. At step 1901, an ager cycletrigger is checked. If trigger is not ON, the ager waits for the agercycle trigger at step 1902. If the trigger is ON, the ager waits forentry to be read and available from memory at step 1903. Then, the agerchecks if flood state is ON and timeout is expired at step 1904. If yes,the ager removes flood state, updates entry and reports event at step1906. Next, the ager checks if end of memory is reached at step 1907. Ifyes, the ager waits for the start of next ager cycle trigger at step1909. If end of memory is not reached, the processing goes to the nextmemory location at step 1908 and ager flow goes back to step 1903 again.Back to step 1904, if flood state is not ON and timeout is not expired,the ager removes the entry, updates the learn thresholds at step 1905.Then, the ager flow goes to step 1907.

FIG. 20 is an example of a computer system 2000 with which embodimentsof the present disclosure may be utilized. Computer system 2000 mayrepresent or form a part of integrated system 100 for the prevention ofnetwork attacks.

Embodiments of the present disclosure include various steps, which willbe described in more detail below. A variety of these steps may beperformed by hardware components or may be tangibly embodied on acomputer-readable storage medium in the form of machine-executableinstructions, which may be used to cause a general-purpose orspecial-purpose processor programmed with instructions to perform thesesteps. Alternatively, the steps may be performed by a combination ofhardware, software, and/or firmware.

As shown, computer system 2000 includes a bus 2030, a processor 2005,communication port 2010, a main memory 2015, a removable storage media2040, a read only memory 2020 and a mass storage 2025. A person skilledin the art will appreciate that computer system 2000 may include morethan one processor and communication ports.

Examples of processor 2005 include, but are not limited to, an Intel®Itanium® or Itanium 2 processor(s), or AMD® Opteron® or Athlon MP®processor(s), Motorola® lines of processors, FortiSOC™ system on a chipprocessors or other future processors. Processor 2005 may includevarious modules associated with monitoring unit as described in FIG. 2.Processor 2005 may include parameter fetching module 220 for fetchingparameters shared by other networks.

Communication port 2010 can be any of an RS-232 port for use with amodem based dialup connection, a 10/100 Ethernet port, a Gigabit or 10Gigabit port using copper or fiber, a serial port, a parallel port, orother existing or future ports. Communication port 2010 may be chosendepending on a network, such a Local Area Network (LAN), Wide AreaNetwork (WAN), or any network to which computer system 2000 connects.

Memory 2015 can be Random Access Memory (RAM), or any other dynamicstorage device commonly known in the art. Read only memory 2020 can beany static storage device(s) such as, but not limited to, a ProgrammableRead Only Memory (PROM) chips for storing static information such asstart-up or BIOS instructions for processor 2005.

Mass storage 2025 may be any current or future mass storage solution,which can be used to store information and/or instructions. Exemplarymass storage solutions include, but are not limited to, ParallelAdvanced Technology Attachment (PATA) or Serial Advanced TechnologyAttachment (SATA) hard disk drives or solid-state drives (internal orexternal, e.g., having Universal Serial Bus (USB) and/or Firewireinterfaces), such as those available from Seagate (e.g., the SeagateBarracuda 7200 family) or Hitachi (e.g., the Hitachi Deskstar 7K1000),one or more optical discs, Redundant Array of Independent Disks (RAID)storage, such as an array of disks (e.g., SATA arrays), available fromvarious vendors including Dot Hill Systems Corp., LaCie, NexsanTechnologies, Inc. and Enhance Technology, Inc.

Bus 2030 communicatively couples processor(s) 2005 with the othermemory, storage and communication blocks. Bus 2030 can be, such as aPeripheral Component Interconnect (PCI)/PCI Extended (PCI-X) bus, SmallComputer System Interface (SCSI), USB or the like, for connectingexpansion cards, drives and other subsystems as well as other buses,such a front side bus (FSB), which connects processor 2005 to systemmemory.

Optionally, operator and administrative interfaces, such as a display,keyboard, and a cursor control device, may also be coupled to bus 2030to support direct operator interaction with computer system 2000. Otheroperator and administrative interfaces can be provided through networkconnections connected through communication port 2010.

Removable storage media 2040 can be any kind of external hard-drives,floppy drives, IOMEGA® Zip Drives, Compact Disc-Read Only Memory(CD-ROM), Compact Disc-Re-Writable (CD-RW), Digital Video Disk-Read OnlyMemory (DVD-ROM).

Components described above are meant only to exemplify variouspossibilities. In no way should the aforementioned exemplary computersystem limit the scope of the present disclosure.

The methods described above lead to the reduction of queries andresponses reaching the SIP servers and thus advantageously reduce theload on the SIP servers during rate-based floods.

Although embodiments of the present invention and their variousadvantages have been described in detail, it should be understood thatthe present invention is not limited to or defined by what is shown ordiscussed herein.

Moreover, as one skilled in the art will appreciate, any digitalcomputer systems can be configured or otherwise programmed to implementthe methods and apparatuses disclosed herein, and to the extent that aparticular digital computer system is configured to implement themethods and apparatuses of this invention, it is within the scope andspirit of the present invention. Once a digital computer system isprogrammed to perform particular functions pursuant tocomputer-executable instructions from program software that implementsthe present invention, it in effect becomes a special purpose computerparticular to the present invention. The techniques necessary to achievethis are well known to those skilled in the art and thus are not furtherdescribed herein.

Computer executable instructions implementing the methods and techniquesof the present invention can be distributed to users on acomputer-readable medium and are often copied onto a hard disk or otherstorage medium. When such a program of instructions is to be executed,it is usually loaded into the random access memory of the computer,thereby configuring the computer to act in accordance with thetechniques disclosed herein. All these operations are well known tothose skilled in the art and thus are not further described herein. Theterm “computer-readable medium” encompasses distribution media,intermediate storage media, execution memory of a computer, and anyother medium or device capable of storing for later reading by acomputer a computer program implementing the present invention.

Accordingly, drawings, tables, and description disclosed hereinillustrate technologies related to the invention, show examples of theinvention, and provide examples of using the invention and are not to beconstrued as limiting the present invention. Known methods, techniques,or systems may be discussed without giving details, so to avoidobscuring the principles of the invention. As it will be appreciated byone of ordinary skill in the art, the present invention can beimplemented, modified, or otherwise altered without departing from theprinciples and spirit of the present invention. Therefore, the scope ofthe present invention should be determined by the following claims andtheir legal equivalents.

We claim:
 1. An apparatus capable of enforcing network policies and preventing attacks related to header, state, rate and content anomalies, wherein the attacks include Session Initiation Protocol (SIP) attacks, said apparatus comprising: a) a Packet Interface that receives inbound/outbound packets, stores the packets in a memory buffer, releases the packets with corresponding packet-ids to a plurality of decision-making blocks for inspection, drops the packets altogether, and sends the packets onto forensic ports based on a unified decision by the plurality of decision-making blocks; b) a Classifier that comprises a SIP Classifier, that is coupled to the Packet Interface, and that classifies packets received from the Packet Interface and retrieves layer 2, layer 3, layer 4, and layer 7 header information from the packets; c) a Header and State Anomaly Prevention Engine that comprises a SIP State Anomaly Engine, that is coupled to the Classifier via a classification bus, and that determines layers 2, 3, 4, and 7 header and state anomalies, including one or more of (1) a Command Sequence (CSeq) header in a SIP request exceeding a first predetermined threshold; and (2) a mismatch between a CSeq header method and a method name in a corresponding request line; d) a Continuous and Adaptive Rate Anomaly Prevention Engine that comprises a SIP Rate Anomaly Engine, that is coupled to the classification bus, and that determines and estimates rate thresholds for layers 2, 3, 4, and 7 parameters and subsequently determines rate anomalies for these parameters; e) a Recon Prevention Engine that is coupled to the classification bus and determines recon activities at layers 3 and 4; f) a Content Anomaly Engine that comprises a SIP Content Anomaly Engine, that is coupled to the classification bus, and that identifies attacks on SIP using signatures; g) a Policy Lookup Engine that comprises a SIP Policy Engine, that is coupled to the classification bus, and that determines policy violation in packets; and h) a Decision Multiplexer for generating the unified decision about a packet-id based on information received from the plurality of decision-making blocks including the Header and State Anomaly Prevention Engine, the Continuous and Adaptive Rate Anomaly Prevention Engine, the Recon Prevention Engine, the Content Anomaly Engine, and the Policy Lookup Engine.
 2. The apparatus of claim 1, further comprising a host interface for setting necessary data structures in memory of logic blocks through host commands.
 3. The apparatus of claim 1, further comprising copper interfaces, fiber interfaces, or a combination of both, through which the Packet Interface receives the inbound/outbound packets.
 4. The apparatus of claim 1, wherein the Classifier further comprises: layers 2, 3, 4, and 7 classifiers, wherein the SIP classifier is a layer 7 classifier; a Fragment Reassembly Engine for assembling the packets; a Transmission Control Protocol (TCP) Reorder Processing and Retransmission Removal Engine for ordering the assembled packets; and a Protocol Normalization Engine for normalizing the ordered packets.
 5. The apparatus of claim 4, wherein the Fragment Reassembly Engine performs fragment reassembly to accurately classify packets at layer 4; and wherein the Fragment Reassembly Engine provides statistics for rate anomalies for fragmented packets and header anomalies for packets with fragmentation related anomalies.
 6. The apparatus of claim 5, wherein the TCP Reorder Processing and Retransmission Removal Engine performs TCP reordering and retransmission removal at layer 4 to accurately classify fragment-assembled packets for content inspection at layer 7; and wherein the TCP Reorder Processing and Retransmission Removal Engine operates to isolate packets with retransmission anomalies.
 7. The apparatus of claim 6, wherein the Protocol Normalization Engine performs protocol normalization on the assembled and ordered packets to accurately classify these packets for content inspection at layer 7; and wherein the Protocol Normalization Engine operates to isolate packets with content anomalies.
 8. The apparatus of claim 4, further comprising: a Multi-rule Search Engine for isolating a rule-set that matches a given packet among a set of rules based on the given packet's network parameters identified by the layer 2, 3, 4 and 7 classifiers; a Rule Matching Engine for validating each rule from the rule-set identified by Multi-rule Search Engine; a Content Inspection Engine for providing necessary stateful content inspection; a Stateful Sub-rule Traversal Engine operating along with the Rule Matching Engine and the Content Inspection Engine to statefully parse signatures across the packets and validate packets that match all signatures; and an Event Queuing Engine for the Rule Matching Engine to deposit events related to content matches, the Event Queuing Engine later combines and prioritizes all events for a given packet and outputs a corresponding decision to the Decision Multiplexer.
 9. The apparatus of claim 1, further comprising: a Layer 2 Rate Anomaly Meter for detecting and preventing Layer 2 rate anomalies in layer 2 parameters; a Layer 3 Rate Anomaly Meter for detecting and preventing Layer 3 rate anomalies in layer 3 parameters; a Layer 4 Rate Anomaly Meter for detecting and preventing Layer 4 rate anomalies in layer 4 parameters; and a Layer 7 Rate Anomaly Meter for detecting and preventing Layer 7 rate anomalies in layer 7 parameters.
 10. The apparatus of claim 9, wherein the layer 2 parameters include Address Resource Protocol (ARP), Reverse ARP (RARP), Broadcast, Multicast, Non-Internet Protocol (IP), Virtual Local Area Network (VLAN), and Double Encapsulated VLAN; the layer 3 parameters include Source, Destination, Type of Service (TOS), IP Options, Fragmented Packets, and Protocols; the layer 4 parameters include TCP Ports, User Datagram Protocol (UDP) Ports, Internet Control Message Protocol (ICMP) Type/Codes, synchronization (SYN) packets, and Connection Rates; and the layer 7 parameters include Hyper-Text Transfer Protocol (http) Requests, HTTP Replies, File Transfer Protocol (FTP) Requests, FTP Replies, TELNET commands and replies, Domain Name Service (DNS) queries and replies, Session Initiation Protocol (SIP) requests and replies, Simple Mail Transfer Protocol (SMTP) commands and replies, Postal Office Protocol (POP) commands and replies, and Remote Procedure Call (RPC) methods and replies.
 11. A system for enforcing network policies and preventing attacks related to header, state, rate and content anomalies, wherein the attacks include Session Initiation Protocol (SIP) attacks, said system comprising: a controlling host; an apparatus coupled to the controlling host, comprising: a) a Packet Interface for receiving inbound/outbound packets, storing the packets in a memory buffer, releasing the packets with corresponding packet-ids to a plurality of decision-making blocks for inspection, dropping the packets altogether, and sending the packets onto forensic ports based on a unified decision by the plurality of decision-making blocks; b) a Classifier that comprises a SIP Classifier, that is coupled to the Packet Interface, and that classifies packets received from the Packet Interface and retrieves layer 2, layer 3, layer 4, and layer 7 header information from the packets; c) a Header and State Anomaly Prevention Engine that comprises a SIP State Anomaly Engine, that is coupled to the Classifier via a classification bus, and that determines layers 2, 3, 4, and 7 header and state anomalies, including one or more of (1) a Command Sequence (CSeq) header in a SIP request exceeding a first predetermined threshold; and (2) a mismatch between a CSeq header method and a method name in a corresponding request line; d) a Continuous and Adaptive Rate Anomaly Prevention Engine that comprises a SIP Rate Anomaly Engine, that is coupled to the classification bus, and that determines and estimates rate thresholds for layers 2, 3, 4, and 7 parameters and subsequently determines rate anomalies for these parameters; e) a Recon Prevention Engine that is coupled to the classification bus and determines recon activities at layers 3 and 4; f) a Content Anomaly Engine that comprises a SIP Content Anomaly Engine, that is coupled to the classification bus, and that identifies attacks on SIP using signatures; g) a Policy Lookup Engine that comprises a SIP Policy Engine, that is coupled to the classification bus, and that determines policy violation in packets; and h) a Decision Multiplexer for generating the unified decision about a packet-id based on information received from the plurality of decision-making blocks including the Header and State Anomaly Prevention Engine, the Continuous and Adaptive Rate Anomaly Prevention Engine, the Recon Prevention Engine, the Content Anomaly Engine, and the Policy Lookup Engine; and i) a host interface for setting necessary data structures in memory of logic blocks through host commands.
 12. The system of claim 11, wherein the Classifier further comprises: layers 2, 3, 4, and 7 classifiers; a Fragment Reassembly Engine for assembling the packets and providing statistics for rate anomalies for fragmented packets and header anomalies for packets with fragmentation related anomalies; a TCP Reorder Processing and Retransmission Removal Engine for ordering the packets and isolating packets with retransmission anomalies; and a Protocol Normalization Engine for normalizing the packets and isolating packets with content anomalies.
 13. The system of claim 11, further comprising: a Layer 2 Rate Anomaly Meter for detecting and preventing Layer 2 rate anomalies in layer 2 parameters; wherein layer 2 parameters include ARP, RARP, Broadcast, Multicast, Non-IP, VLAN, and Double Encapsulated VLAN; a Layer 3 Rate Anomaly Meter for detecting and preventing Layer 3 rate anomalies in layer 3 parameters; wherein layer 3 parameters include Source, Destination, TOS, IP Options, Fragmented Packets, and Protocols; a Layer 4 Rate Anomaly Meter for detecting and preventing Layer 4 rate anomalies in layer 4 parameters; wherein layer 4 parameters include TCP Ports, UDP Ports, ICMP Type/Codes, SYN packets, and Connection Rates; and a Layer 7 Rate Anomaly Meter for detecting and preventing Layer 7 rate anomalies in layer 7 parameters; wherein the layer 7 parameters include Hyper-Text Transfer Protocol (http) Requests, HTTP Replies, File Transfer Protocol (FTP) Requests, FTP Replies, TELNET commands and replies, DNS queries and replies, Session Initiation Protocol (SIP) requests and replies, Simple Mail Transfer Protocol (SMTP) commands and replies, Postal Office Protocol (POP) commands and replies, and Remote Procedure Call (RPC) methods and replies.
 14. The system of claim 11, wherein the SIP classifier classifies TCP and UDP based SIP packets and components of SIP protocol headers.
 15. The system of claim 11, wherein the SIP Rate Anomaly Engine continuously calculates the traffic rate on classified SIP parameters and estimates traffic rate thresholds adaptively and thus determines threshold violations on the SIP parameters including SIP requests and responses.
 16. The system of claim 15, wherein the SIP State Anomaly Engine interacts with the SIP Rate Anomaly Engine and uses state information in packets to selectively drop excessive packets during rate-based floods.
 17. The system of claim 16, wherein the SIP State Anomaly Engine validates responses via a SIP state machine table and drops the responses if there is no previous corresponding request associated therewith.
 18. The system of claim 15, wherein the SIP State Anomaly Engine consults a SIP Session table to ensure that no SIP BYE is allowed unless a session has been registered.
 19. The system of claim 11, wherein the SIP Content Anomaly Engine utilizes classified SIP data to determine content patterns of intrusion.
 20. The system of claim 11, wherein the SIP Policy Anomaly Engine utilizes classified SIP data to determine policy violations on session initiation protocol. 